app chooser: Avoid duplicates
authorMatthias Clasen <mclasen@redhat.com>
Tue, 22 Sep 2015 19:14:00 +0000 (15:14 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 22 Sep 2015 19:17:02 +0000 (15:17 -0400)
At the time we populate the model "initially" in constructed(),
it has already been filled and cleared a couple of times (we do
that every time one of the construct properties gets set). So
we can't assume that the model is empty, and have to clear it
first. Otherwise, we add duplicates to the list.

https://bugzilla.gnome.org/show_bug.cgi?id=748080

gtk/gtkappchooserwidget.c

index aa6b0dff30eb8d0a752384878159929014cf26a8..7e2117ce8065df1a4cbba7c90e1d113e5f15a6d1 100644 (file)
@@ -813,7 +813,7 @@ gtk_app_chooser_widget_initialize_items (GtkAppChooserWidget *self)
                 NULL);
 
   /* populate the widget */
-  gtk_app_chooser_widget_real_add_items (self);
+  gtk_app_chooser_refresh (GTK_APP_CHOOSER (self));
 }
 
 static void